#ifndef ANGELSCRIPT_EDITOR_EXTENSION_HPP
#define ANGELSCRIPT_EDITOR_EXTENSION_HPP

#include "angelscript_base.hpp"
#include "scripting/scripting_api.h"

#include <string_view>

class AngelScriptEditorExtension final : public IEditorScript, AngelScriptBase
{
public:
    AngelScriptEditorExtension(IEditorScript::EditorTarget target, std::string title, const std::string &script_path);
    ~AngelScriptEditorExtension();
    void execute(const void *data) override;
    static IScript* create(IEditorScript::EditorTarget target, std::string title, const std::string_view &code, const std::string &script_path);

private:
    bool compile(const std::string_view &code);
};

#endif /* ANGELSCRIPT_EDITOR_EXTENSION_HPP */
